import time
from math import *
def Pipa (z):
    x = time.time()
    a = open(z)
    h = []
    for i in a:
        h.append(a.readline())
    for q in range(len(h)):
        for j in range(len(h)-1):
            if h[j] < h[j+1]:
                h[j],  h[j+1] = h[j+1], h[j]
    y = time.time()
    return(y - x)

print('m1_sorted', int(round(Pipa('m1_sorted.txt'), 3) * 1000), 'milliseconds')
print('m2_reverse', int(round(Pipa('m2_reverse.txt'), 3) * 1000), 'milliseconds')
print('m3_shuffle', int(round(Pipa('m3_shuffle.txt'), 3) * 1000), 'milliseconds')
